import { createWebHashHistory, createRouter } from "vue-router";
import LoginView from "../pages/login/index.vue";
import Layout from "../components/layout/index.vue";

const routes = [
  { path: "/", redirect: "/login" },
  { path: "/login", component: LoginView },
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "/business/home",
        name: "业务管理-首页",
        meta: {
          title: "业务管理-首页",
          tabActive: "1",
          hideBg: true,
        },
        component: () => import("../pages/business/home/index.vue"),
      },
      {
        path: "/sellerMan",
        name: "商户管理",
        meta: {
          title: "商户管理",
          hideBg: true,
        },
        component: () => import("../pages/sellerMan/index.vue"),
      },
      {
        path: "/news",
        name: "消息管理",
        meta: {
          title: "消息管理",
          hideBg: true,
        },
        component: () => import("../pages/news/index.vue"),
      },
      {
        path: "/accountMana",
        name: "账号管理",
        meta: {
          title: "账号管理",
          hideBg: true,
        },
        component: () => import("../pages/accountMana/index.vue"),
      },
      {
        path: "/articleManage",
        name: "文章管理",
        meta: {
          title: "文章管理",
          hideBg: true,
        },
        component: () => import("../pages/articleManage/index.vue"),
      },
      {
        path: "/articleManage/edit",
        name: "文章编辑",
        meta: {
          title: "文章编辑",
          hideBg: true,
        },
        component: () => import("../pages/articleManage/edit.vue"),
      },
      {
        path: "/feedback",
        name: "意见反馈",
        meta: {
          title: "意见反馈",
          hideBg: true,
        },
        component: () => import("../pages/feedback/index.vue"),
      },
      {
        path: "/vipUser",
        name: "会员用户管理",
        meta: {
          title: "会员用户管理",
          hideBg: true,
        },
        component: () => import("../pages/vipUser/index.vue"),
      },
      {
        path: "/decorate_pc/swiperManage",
        name: "轮播图管理",
        meta: {
          title: "轮播图管理",
        },
        component: () => import("../pages/decorate_pc/swiperManage/index.vue"),
      },
      {
        path: "/sellerAnnualFee",
        name: "商户年费管理",
        meta: {
          title: "商户年费管理",
        },
        component: () => import("../pages/sellerAnnualFee/index.vue"),
      },
      {
        path: "/cate_lists",
        name: "菜品分类",
        meta: {
          title: "菜品分类",
        },
        component: () => import("../pages/cate_lists/index.vue"),
      },
      {
        path: "/dishMana",
        name: "菜品管理",
        meta: {
          title: "菜品管理",
        },
        component: () => import("../pages/dishMana/index.vue"),
      },
      {
        path: "/discountActivity",
        name: "折扣活动",
        meta: {
          title: "折扣活动",
        },
        component: () => import("../pages/discountActivity/index.vue"),
      },
      {
        path: "/order/orderList",
        name: "菜品订单列表",
        meta: {
          title: "菜品订单列表",
        },
        component: () => import("../pages/order/orderList/index.vue"),
      },
      {
        path: "/order/refundAfterSales",
        name: "退款售后",
        meta: {
          title: "退款售后",
        },
        component: () => import("../pages/order/refundAfterSales/index.vue"),
      },
      {
        path: "/order/reviewMana",
        name: "评价管理",
        meta: {
          title: "评价管理",
        },
        component: () => import("../pages/order/reviewMana/index.vue"),
      },
      {
        path: "/store/withdrawalMana",
        name: "提现管理",
        meta: {
          title: "提现管理",
        },
        component: () => import("../pages/store/withdrawalMana/index.vue"),
      },
      {
        path: "/store/pointsSetting",
        name: "积分设置",
        meta: {
          title: "积分设置",
        },
        component: () => import("../pages/store/pointsSetting/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
